﻿package mortal.game.view.copy.singleTowerCopy2.panel
{
    import Message.DB.Tables.*;
    import com.gengine.resource.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.common.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.copy.QuestionCopy.data.*;
    import mortal.game.view.copy.groupCopy.view.*;
    import mortal.game.view.copy.singleTowerCopy2.item.*;
    import mortal.mvc.core.*;

    public class SingleTowerCopyPanel2 extends GroupCopyBasePanel
    {
        protected var _leftP:SingleTowerLeftPanel;
        protected var _rightP:SingleTowerRightPanel;
        private var _tcopy:TCopy;

        public function SingleTowerCopyPanel2()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            LoaderHelp.addResCallBack(ResFileConst.sigleTowerCopy, this.onShow);
            return;
        }// end function

        private function onShow() : void
        {
            this._leftP = UIFactory.getUICompoment(SingleTowerLeftPanel, 0, 0, this);
            this._rightP = UIFactory.getUICompoment(SingleTowerRightPanel, 413, -4, this);
            this.addEnts(true);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            LoaderHelp.removeResEvent(ResFileConst.sigleTowerCopy, this.onShow);
            if (this._leftP)
            {
                this.addEnts(false);
            }
            this._leftP = null;
            this._rightP = null;
            super.disposeImpl(param1);
            return;
        }// end function

        private function addEnts(param1:Boolean) : void
        {
            EventUtil.addSelfEvent(EventName.SingleTower2RightCopySelect, this.onCopySelect, param1);
            return;
        }// end function

        private function onCopySelect(event:DataEvent) : void
        {
            var _loc_2:* = int(event.data.lv);
            return;
        }// end function

        private function clickHandler(event:Event) : void
        {
            if (LevelCheckUtil.curLevel < this._tcopy.enterMinLevel)
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(70955, this._tcopy.enterMinLevel));
                return;
            }
            var _loc_2:int = 1;
            Dispatcher.dispatchEvent(new DataEvent(EventName.SingleTower2Enter, {tcopy:this._tcopy, lv:_loc_2}));
            return;
        }// end function

    }
}
